var util = require("util");

function Base() {
  this.name = "base";
  this.base = 1991;

  this.sayHello = function () {
    console.log("Hello " + this.name);
  };
}

Base.prototype.showName = function () {
  console.log(this.name);
};

function Sub() {
  this.name = "sub";
}

console.log("=======Base=======");
util.inherits(Sub, Base);
var objBase = new Base();
objBase.showName();
objBase.sayHello();
console.log(objBase);

console.log("=======Sub=======");
var objSub = new Sub();
objSub.showName();
//objSub.sayHello();
console.log(objSub);

console.log("=======inspect=======");
function Person() {
  this.name = "byvoid";
  this.toString = function () {
    return this.name;
  };
}
var obj = new Person();
console.log(util.inspect(obj));
console.log(util.inspect(obj, true));
